/**
 * Created by oneminute on 8/30/14.
 */

var winston = require("winston");
var moment = require("moment");
var servers = require("./servers_config");
var rabbitServerConfig = require("./rabbit_config");

exports = module.exports = {
    transports: [
        /*new (winston.transports.Console)({
            'timestamp': function () {
                return moment().format('YYYY-MM-DD HH:mm:ss:SSS');
            },
            level: 'debug',
            colorize: 'true',
            label: "iwant " + process.pid,
            prettyPrint: true
        }),*/
        new (winston.transports.MessageQueue)({
            'timestamp': function () {
                return moment().format('YYYY-MM-DD HH:mm:ss:SSS');
            },
            level: 'debug',
            colorize: 'true',
            label: "iwant " + process.pid,
            prettyPrint: true,
            //stringify: true,
            json: true,
            rabbitOpts: rabbitServerConfig.server,
            exchangeName: rabbitServerConfig.log.exchange,
            publishOpts: rabbitServerConfig.log.publishOpts,
            routingKey: rabbitServerConfig.log.routingKey
        })
    ]
};
